package com.dbappsecurity.bifrost.view;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.EditText;
import com.dbappsecurity.bifrost.R;

public class DemoActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_demo);

    EditText editText = findViewById(R.id.txt);

    Button button1 = findViewById(R.id.ahtBtn);
    Button button2 = findViewById(R.id.ahtTsgz);
    Button button3 = findViewById(R.id.demoBtn);

    button1.setOnClickListener(v -> editText.setText("https://aht.dbappsecurity.com.cn/"));
    button2.setOnClickListener(
        v -> editText.setText("https://nssa.dbappsecurity.com.cn:7382/#/login"));

    button3.setOnClickListener(v -> {
      Intent intent = new Intent(DemoActivity.this, MainActivity.class);
      intent.setData(Uri.parse(editText.getText().toString()));
      startActivity(intent);
    });
  }
}
